package net.lovedna.config {
	import net.lovedna.data.IMessage;

	import flash.utils.Dictionary;
	import flash.utils.getQualifiedClassName;
	/**
	 * @author hi
	 */
	public class RequestConfig {
		private var _dict:Dictionary=new Dictionary();
		public function add(action:String,request:Class):void{
			var qc:String=getQualifiedClassName(request);
			if(_dict[action]!=undefined){
				throw new Error(action+"已经配制过了。不要重复添加。");
			}
			_dict[qc]=action;
		}
		public function getProtocol(request:IMessage):String{
			var qc:String=getQualifiedClassName(request);
			return _dict[qc];
		}
	}
}
